
<template>
    <el-row class="tac">
      <el-col :span="12">
        <el-menu
          :default-active="activeIndex"
          class="el-menu-vertical-demo"
          router="true"
        >
          <el-menu-item v-for="item,index in routes" :key="index" :index="item.path" @click="activeIndex
          =index" :class="activeIndex==index?'is-active':''">
            <span>{{ item.meta.title }}</span>
          </el-menu-item>
        </el-menu>
      </el-col>
    </el-row>
  </template>
  
  <script lang="ts" setup>
  import { onMounted, ref } from 'vue';
  import {
    Menu as IconMenu,
    Location,
  } from '@element-plus/icons-vue'
import { useRoute } from 'vue-router';
  let activeIndex=ref(0)
  let route=useRoute();
  let routes=route.matched[0].children as any
  onMounted(()=>{
    console.log(route.matched[0]);
  })
  </script>
  
